/*
创建数据模型 和 mongdb的数据表做关联
1. 创建scheme对象
2. 将schema对象转化为数据模型
3. 调用数据模型下的方法操作数据库
*/
const mongoose = require("mongoose");

const Schema = mongoose.Schema;
let userSchema = new Schema({
  user: { type: String, required: true },
  pwd: { type: String, required: true },
  token: { type: String, default: null },
  ctime: { type: Date, default: Date.now },
});

let userModel = mongoose.model("user", userSchema);

module.exports = userModel;
